Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: presign url using blob storage #82

Merged
merged 11 commits into from
Jan 25, 2024

Conversation

bestmike007
Copy link
Contributor

What changed? Why?

PreSigned url needs to be moved into specific blob storage type.

How did you test the change?

GitHub Actions

Signed-off-by: bestmike007 <i@bestmike007.com>
@bestmike007 bestmike007 requested a review from a team as a code owner January 15, 2024 16:24
Signed-off-by: bestmike007 <i@bestmike007.com>
bestmike007 and others added 6 commits January 23, 2024 09:55
Co-authored-by: Jie Zhang <zhangjie@gmail.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
Signed-off-by: bestmike007 <i@bestmike007.com>
@bestmike007 bestmike007 force-pushed the feat/presign-url-in-blob-storage branch from a092a8d to b3faa94 Compare January 23, 2024 03:04
Signed-off-by: bestmike007 <i@bestmike007.com>
@@ -715,7 +715,8 @@ func (s *Server) newBlockFile(block *api.BlockMetadata) (*api.BlockFile, error)
compression := storage_utils.GetCompressionType(key)
fileUrl, err := s.blobStorage.PreSign(context.Background(), key)
if err != nil {
return nil, err
s.logger.Error("block file s3 presign error", zap.String("key", key), zap.Error(err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is a logging interceptor taking care of the logs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed.

@@ -715,7 +715,8 @@ func (s *Server) newBlockFile(block *api.BlockMetadata) (*api.BlockFile, error)
compression := storage_utils.GetCompressionType(key)
fileUrl, err := s.blobStorage.PreSign(context.Background(), key)
if err != nil {
return nil, err
s.logger.Error("block file s3 presign error", zap.String("key", key), zap.Error(err))
return nil, status.Errorf(codes.Internal, "internal block file url generation error: %+v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all errors are by default mapped to internal by the error interceptor. no need to repeat it here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -25,6 +25,9 @@ aws:
region: us-east-1
storage:
data_compression: GZIP
gcp:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to change GcpConfig to a pointer so it becomes optional. Then I guess we don't need to add this section to the default template?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's already a pointer, so optional. However, since we marked the presigned_url_expiration required, we need a default value for it because gcp project is always required for firestore.

@jiezhang jiezhang merged commit 2172684 into coinbase:master Jan 25, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants